<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>修改公告内容</title>
		<link type="text/css" rel="stylesheet" href="<%=basePath %>jquery-easyui-1.4.2/themes/default/easyui.css">
		<link type="text/css" rel="stylesheet" href="<%=basePath %>jquery-easyui-1.4.2/themes/icon.css">
		<script type="text/javascript" src="<%=basePath %>js/jquery-2.1.1.min.js"></script>
		<script type="text/javascript" src="<%=basePath %>jquery-easyui-1.4.2/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="<%=basePath %>jquery-easyui-1.4.2/locale/easyui-lang-zh_CN.js"></script>
		<link rel="stylesheet" href="<%=basePath %>ueditor/themes/default/_css/umeditor.css" />
		<script type="text/javascript" src="<%=basePath %>ueditor/umeditor.config_clz.js" ></script>
		<script type="text/javascript" src="<%=basePath %>ueditor/umeditor.min.js" ></script>
		<script type="text/javascript" src="<%=basePath %>ueditor/lang/zh-cn/zh-cn.js" ></script>
		
		<style type="text/css">
			.td_text{
				text-align: right;
				padding-top: 8px;
			}
			.td_input{
				padding-left:15px ;
				padding-top: 10px;
			}
			
			
	</style>
	<script type="text/javascript">
		//添加修改信息
		function updateOrcSaveContent() {
			var publisherId = $("#userIdID").val();
			var bn_id =  $("#bn_id").val();
			var title = $("#title").val();
			var content = UM.getEditor("editor").body.innerHTML;
			var enclosureUrl = $("#enclosureUrl").val();
			var category = $("#category").val();
			var userType = $("#menuisShowUpdata").combobox("getValue");
			$.ajax({
				type:"post",
				url:"<%=basePath%>bulletin/updataOrSaveBulletion.do",
				data:{
					"publisherId":publisherId,
					"bn_id":bn_id,
					"title":title,
					"content":content,
					"enclosureUrl":enclosureUrl,
					"category":category
				},
				dataType:"json",
				success:function(data){
					if (data == "ok") {
						$.messager.alert('完成','内容保存成功','success',function(){
							window.history.back();
						});
					}
				}
			})
			
			
		}
	</script>
</head>
<body class="easyui-layout" style="margin: auto;">
			<input id="userIdID" type="hidden" value="${user.userId}">
			<input id="bn_id" type="hidden" value="${bulletinContentUpdate.bn_id}">
			<input id="category" type="hidden" value="${bulletinContentUpdate.category}">
				<table style="width: 95%;margin-left: 35px;margin-top: 25px;">
					<tr>
						<td class="td_text" width="50px">标题:</td>
						<td class="td_input"><input id="title" class="easyui-textbox"style="width:40%;height: 25px" value="${bulletinContentUpdate.title}"></td>
					</tr >
					<tr height="20px">
						<td class="td_text">状态:</td>
						<td style="padding-left: 15px">
							<select id="menuisShowUpdata" name="menuisShow" class="easyui-combobox input" style="width: 100px;height: 25px">   
			   					<option value="1">使用</option>
			   					<option value="0">不使用</option>
			   				</select>
			   			</td>
		   			</tr>
					<tr top="20px">
						<td class="td_text" width="50px">内容:</td>
						<td style="padding-left: 15px">
							<textarea id="editor" style="width: 80%;height: 280px;">${bulletinContentUpdate.content}</textarea>
						</td>
								<script type="text/javascript">
									//渲染编辑器
						    		var ue = UM.getEditor('editor');
						    		function aa(imgUrl){
					    				alert(imgUrl);
					    			}
								</script>
					<tr>
						<td class="td_text">附件:</td>
						<td class="td_input"><input id="enclosureUrl"  class="easyui-filebox" name="file2" data-options="prompt:'点击右侧按钮选择文件',buttonText:'选择文件'" style="width:20%" value="${bulletinContentUpdate.enclosureUrl}">(附件最多20M)</td>
					</tr>
				</table>
				<a style="margin-left: 70%" href="javascript:updateOrcSaveContent();" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">&nbsp;保&nbsp;存&nbsp;</a>

	</body>
	
</html>